/**   
 * @Title: Errors.java 
 * @Package com.esun.network 
 * @Description: (出错信息处理) 
 * @author City Jiangsy@500wan.com   
 * @date 2011-6-22 下午07:36:12  
 * Copyright (C) 2011 Shenzhen E-sun Sky Net Technology Co.,ltd.
 */
package com.esun.network;

import com.esun.util.log.EDebug;

/**
 * @ClassName: Errors
 * @Description: (出错信息处理)
 * @author City Jiangsy@500wan.com
 * @date 2011-6-22 下午07:36:12
 * 
 */
public class Errors {
	private String errorMSG = "";
	private String errorCode = "";
	private String serverMsg = "";

	private String MSG_100 = "操作成功";
	private String MSG_101 = "失败";
	private String MSG_102 = "未登录";
	private String MSG_103 = "投注出错";
	private String MSG_104 = "方案为上传";
	private String MSG_105 = "金额不足";
	private String MSG_106 = "方案发起成功,文件上传失败";
	private String MSG_107 = "停止销售";
	private String MSG_108 = "销售时间截止";
	// private String MSG_109 = "用户名或密码错误";
	private String MSG_110 = "无投注密码";
	private String MSG_111 = "刷新用户余额";
	private String MSG_112 = "未绑定银行卡";
	private String MSG_201 = "双色球期号列表错误";
	private String MSG_202 = "没有更多记录";
	private String MSG_203 = "数据库操作失败";
	private String MSG_204 = "购买期号已过期";
	private String MSG_205 = "获取漏号列表失败";
	private String MSG_206 = "每份金额不能为空或者0";
	private String MSG_207 = "binary提交错误";
	private String MSG_208 = "彩种ID或追号ID错误";
	private String MSG_209 = "暂无对阵信息";
	private String MSG_210 = "读取对阵信息失败";
	private String MSG_211 = "投注类型错误";
	private String MSG_212 = "读取对阵信息失败";
	private String MSG_213 = "注册渠道号错误";
	private String MSG_214 = "获取用户信息失败";
	private String MSG_224 = "暂无最新开奖信息";

	private String MSG_0 = "服务器信息错误";

	protected void setErrorCode(String code) {
		this.errorCode = code;
	}

	protected void setServerMsg(String msg) {
		this.serverMsg = msg;
	}

	public String getErrorCode() {
		return this.errorCode;
	}

	public String getErrorMSG() {
		int iErrorCode = 0;
		try {
			iErrorCode = Integer.parseInt(errorCode);
		} catch (Exception e) {
			// TODO: handle exception
			EDebug.o(this, "have no respons");
		}
		switch (iErrorCode) {
		case 100:
			errorMSG = MSG_100;
			break;

		case 101:
			errorMSG = MSG_101;
			break;

		case 102:
			errorMSG = MSG_102;
			break;

		case 103:
			errorMSG = MSG_103;
			break;

		case 104:
			errorMSG = MSG_104;
			break;

		case 105:
			errorMSG = MSG_105;
			break;

		case 106:
			errorMSG = MSG_106;
			break;

		case 107:
			errorMSG = MSG_107;
			break;

		case 108:
			errorMSG = MSG_108;
			break;

		case 109:
			errorMSG = serverMsg;
			break;

		case 110:
			errorMSG = MSG_110;
			break;

		case 111:
			errorMSG = MSG_111;
			break;

		case 112:
			errorMSG = MSG_112;
			break;

		case 201:
			errorMSG = MSG_201;
			break;

		case 202:
			errorMSG = MSG_202;
			break;

		case 203:
			errorMSG = MSG_203;
			break;

		case 204:
			errorMSG = MSG_204;
			break;

		case 205:
			errorMSG = MSG_205;
			break;

		case 206:
			errorMSG = MSG_206;
			break;

		case 207:
			errorMSG = MSG_207;
			break;

		case 208:
			errorMSG = MSG_208;
			break;

		case 209:
			errorMSG = MSG_209;
			break;

		case 210:
			errorMSG = MSG_210;
			break;

		case 211:
			errorMSG = MSG_211;
			break;

		case 212:
			errorMSG = MSG_212;
			break;

		case 213:
			errorMSG = MSG_213;
			break;

		case 214:
			errorMSG = MSG_214;
			break;

		case 224:
			errorMSG = MSG_224;
			break;

		case 0:
			errorMSG = MSG_0;
			break;

		default:
			break;
		}

		return errorMSG;
	}

}
